package main

import (
	"fmt"
)

type Node2 struct {
	data int
	next *Node2
}

func main() {
	head := &Node2{data: 1, next: &Node2{data: 2, next: &Node2{data: 3, next: nil}}}

	tail := new(Node2)
	for head != nil {
		node := head
		head = head.next
		node.next = tail
		tail = node
	}
	for tail != nil {
		fmt.Println(tail.data)
		tail = tail.next
	}
}
